package com.jic.member.controller.manage;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.member.request.MemberGradeRequest;
import com.jic.member.response.MemberGradeResponse;
import com.jic.member.service.MememberGradeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员等级表
 *
 * @author :
 * @version : v1.0.0
 * @email :
 * @since : 2020-04-03 02:09:28
 */
@RestController
@RequestMapping("memberGrade")
public class MemberGradeController {
    @Autowired
    private MememberGradeService mememberGradeService;

    @ApiOperation("列表查询")
    @ResponseBody
    @RequestMapping("queryList")
    public RestResult<PageResult<MemberGradeResponse>> queryList(@RequestBody MemberGradeRequest request) {
        return mememberGradeService.queryPage(request);
    }


    @ApiOperation("新增列表")
    @RequestMapping("addMemberGradeInfo")
    public RestResult<Long> addMemberGradeInfo(@RequestBody MemberGradeRequest request){
        return mememberGradeService.insert(request);
    }

    @ApiOperation("删除列表")
    @RequestMapping("delMemberGrade")
    public RestResult<Long> delMemberGrade(@RequestBody MemberGradeRequest param){
        return mememberGradeService.delete(param);
    }

    @ApiOperation("修改列表")
    @RequestMapping("editMemberGrade")
    public RestResult<Long> editMemberGrade(@RequestBody MemberGradeRequest param){
        return mememberGradeService.update(param);
    }

    @ApiOperation("店铺等级权益列表查询")
    @ResponseBody
    @RequestMapping("queryStorePowerList")
    public RestResult<PageResult<MemberGradeResponse>> queryStorePowerList(@RequestBody MemberGradeRequest request) {
        return mememberGradeService.queryStorePowerList(request);
    }

    @ApiOperation("店铺等级列表查询")
    @ResponseBody
    @RequestMapping("queryStoreGradeList")
    public RestResult<PageResult<MemberGradeResponse>> queryStoreGradeList(@RequestBody MemberGradeRequest request) {
        return mememberGradeService.queryStoreGradePage(request);
    }

}
